<?php if (isset($_GET['s'])): ?>
    <div class="mdui-center mdui-m-y-5">
        <div class="mdui-card mdui-hoverable mdui-card-content" style="border-radius: 8px">
            <form action="?" method="get">
                <div class="mdui-textfield">
                    <i class="mdui-icon material-icons">search</i>
                    <input type="text" name="s" class="mdui-textfield-input" placeholder="搜索内容" value="<?php echo htmlspecialchars($_GET['s']); ?>" />
                </div>
                <button type="submit" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme mdui-float-right">搜索</button>
            </form>
            <?php if (!empty($postSearch)) : ?>
            <ul class="mdui-list">
                <?php foreach ($postSearch as $post): ?>
                <a href="<?php echo $post['url']; ?>">
                    <li class="mdui-list-item mdui-ripple">
                        <div class="mdui-list-item-content"><?php echo $post['title']; ?></div>
                    </li>
                    <div class="mdui-divider"></div>
                </a>
                <?php endforeach; ?>
            </ul>
            <?php else: ?>
            <div class="mdui-typo">
                <p>未找到相关内容</p>
            </div>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>
